package com.jt.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;

@Data
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class ImageVO implements Serializable {
    /**
     * {"error":o,"url":"图片的保存路径","width":图片的宽度,"height":图片的高度}
     */
    private Integer error;
    private String url;
    private Integer width;
    private Integer height;

    /**
     * 传输失败的返回值
     * @return
     */
    public static ImageVO fail(){
        return  new ImageVO(1, null, null,null);
    }

    /**
     * 传输成功
     * @param url
     * @param width
     * @param height
     * @return
     */
    public static ImageVO success(String url,Integer width,Integer height){
        return new ImageVO(0,url,width,height);
    }

}
